package exception;

/**
 *
 */
public class ExceptionApiDemo {
    public static void main(String[] args) {
        try {
            String str="abc";
            System.out.println(Integer.parseInt(str));
        } catch (NumberFormatException e) {
            e.printStackTrace();//控制台输出异常信息
            String message=e.getMessage();//获取错误消息
            System.out.println(message);
        }

        System.out.println("程序结束了");
    }
}
